package net.godcode.t5c.services;

import org.apache.tapestry.ioc.Configuration;
import org.apache.tapestry.services.LibraryMapping;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * The component library module.
 * 
 * @author Chris Lewis Nov 14, 2007 <chris@thegodcode.net>
 * @version $Id: GodcodeT5CModule.java 32 2007-11-28 15:49:55Z burningodzilla $
 */
public class GodcodeT5CModule {
	
	private static final Logger log = LoggerFactory.getLogger(GodcodeT5CModule.class);
	
	public static void contributeComponentClassResolver(Configuration<LibraryMapping> configuration) {
		/*
		 * Per T5 conventions, all classes in the net.godcode.t5c.components package
		 * will now be treated as components and available under the component
		 * namespace "gc". For example the SlideShow component can be used like this:
		 * <div t:type="gc/slideshow">...</div> 
		 */
		configuration.add(new LibraryMapping("gc", "net.godcode.t5c"));
		log.debug("Successfully added component library! Components available under the 'gc' namespace.");
	}
    
}